import { createMemoryHistory, createRouter } from 'vue-router'

import login from '@/page/LoginPage/LoginPage.vue'
import index from '@/page/indexPage/index.vue'
import ops from '@/page/opsPage/ops.vue'
import cluster from '@/page/clusterPage/cluster.vue'
import setting from '@/page/settingPage/setting.vue'
import opsMenu from '@/page/opsPage/components/opsMenu.vue'
import opsDoProject from '@/page/opsPage/components/opsDoProject.vue'

const routes = [
  { path: '/login',
    component: login },
  { path: '/', 
    component: index },
  { path: '/ops', 
    component: ops,
    children: [
      {
        path: '',
        component: opsMenu,
      },
      {
        path: 'project',
        component: opsDoProject,
      },
    ],
  },
  { path: '/cluster', 
    component: cluster },
  { path: '/setting', 
    component: setting },
]

const router = createRouter({
  history: createMemoryHistory(),
  routes,
})

export default router;